if ( $good ) {
# Invalidate cache of this article and all pages using this article
# as a template. Partly deferred.
- Article::onArticleEdit( $this->mTitle );
-
+ Article::onArticleEdit( $this->mTitle, false ); // leave templatelinks for editUpdates()
# Update links tables, site stats, etc.
$this->editUpdates( $text, $summary, $isminor, $now, $revisionId, $changed );
$dbw->commit();
Article::onArticleCreate( $this->mTitle );
wfRunHooks( 'ArticleInsertComplete', array( &$this, &$user, $text, $summary,
- $flags & EDIT_MINOR, null, null, &$flags, $revision ) );
+ $flags & EDIT_MINOR, null, null, &$flags, $revision ) );
}
if ( $good && !( $flags & EDIT_DEFER_UPDATES ) ) {
/**
* Do standard deferred updates after page edit.
* Update links tables, site stats, search index and message cache.
+ * Purges pages that include this page if the text was changed here.
* Every 100th edit, prune the recent changes table.
*
* @private
}
# Update the links tables
- $u = new LinksUpdate( $this->mTitle, $editInfo->output );
+ $u = new LinksUpdate( $this->mTitle, $editInfo->output, false );
+ $u->setRecursiveTouch( $changed ); // refresh/invalidate including pages too
$u->doUpdate();
if( wfRunHooks( 'ArticleEditUpdatesDeleteFromRecentchanges', array( &$this ) ) ) {
$r = "\n\t\t\t\t<div id=\"mw-{$infomsg}\">" . wfMsg( $infomsg, $td, $userlinks ) . "</div>\n" .
- "\n\t\t\t\t<div id=\"mw-revision-nav\">" . $cdel . wfMsg( 'revision-nav', $prevdiff, $prevlink, $lnk, $curdiff, $nextlink, $nextdiff ) . "</div>\n\t\t\t";
+ "\n\t\t\t\t<div id=\"mw-revision-nav\">" . $cdel . wfMsg( 'revision-nav', $prevdiff,
+ $prevlink, $lnk, $curdiff, $nextlink, $nextdiff ) . "</div>\n\t\t\t";
$wgOut->setSubtitle( $r );
}
* @param $title_obj a title object
*/
- public static function onArticleCreate($title) {
- # The talk page isn't in the regular link tables, so we need to update manually:
+ public static function onArticleCreate( $title ) {
+ # Update existence markers on article/talk tabs...
if ( $title->isTalkPage() ) {
$other = $title->getSubjectPage();
} else {
public static function onArticleDelete( $title ) {
global $wgUseFileCache, $wgMessageCache;
-
- // Update existence markers on article/talk tabs...
+ # Update existence markers on article/talk tabs...
if( $title->isTalkPage() ) {
$other = $title->getSubjectPage();
} else {
/**
* Purge caches on page update etc
*/
- static function onArticleEdit( $title ) {
+ public static function onArticleEdit( $title, $touchTemplates = true ) {
global $wgDeferredUpdateList, $wgUseFileCache;
// Invalidate caches of articles which include this page
- $wgDeferredUpdateList[] = new HTMLCacheUpdate( $title, 'templatelinks' );
+ if( $touchTemplates )
+ $wgDeferredUpdateList[] = new HTMLCacheUpdate( $title, 'templatelinks' );
// Invalidate the caches of all pages which redirect here
$wgDeferredUpdateList[] = new HTMLCacheUpdate( $title, 'redirect' );
$mProperties, //!< Map of arbitrary name to value
$mDb, //!< Database connection reference
$mOptions, //!< SELECT options to be used (array)
- $mRecursive; //!< Whether to queue jobs for recursive updates
+ $mRecursive, //!< Whether to queue jobs for recursive updates
+ $mTouchTmplLinks; //!< Whether to queue HTMLCacheUpdate jobs IF recursive
/**@}}*/
/**
}
$this->mRecursive = $recursive;
+ $this->mTouchTmplLinks = false;
wfRunHooks( 'LinksUpdateConstructed', array( &$this ) );
}
+
+ /**
+ * Invalidate HTML cache of pages that include this page?
+ */
+ public function setRecursiveTouch( $val ) {
+ $this->mTouchTmplLinks = (bool)$val;
+ if( $val ) // Cannot invalidate without queueRecursiveJobs()
+ $this->mRecursive = true;
+ }
/**
* Update link tables with outgoing links from an updated article
*/
- function doUpdate() {
+ public function doUpdate() {
global $wgUseDumbLinkUpdate;
wfRunHooks( 'LinksUpdate', array( &$this ) );
'end' => ( $id !== false ? $id - 1 : false ),
);
$jobs[] = new RefreshLinksJob2( $this->mTitle, $params );
-
+ # Hit page caches while we're at it if set to do so...
+ if( $this->mTouchTmplLinks ) {
+ $params['table'] = 'templatelinks';
+ $jobs[] = new HTMLCacheUpdateJob( $this->mTitle, $params );
+ }
$start = $id;
} while ( $start );